﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Connections
{
    class DatabaseCommand
    {
        private DatabaseConnection specimen;
        private string sqlString;
        public DatabaseCommand(DatabaseConnection DBCon, string input)
        {
            if (DBCon != null)
            {
                SetSqlString = input;
                specimen = DBCon;
            }
        }

        public string SetSqlString
        {
            set
            {
                if (!String.IsNullOrEmpty(value))
                {
                    sqlString = value;
                }
            }
        }

        public void Execute()
        {
            specimen.OpenConnection();
            Console.WriteLine(sqlString);
            specimen.CloseConnection();
        }
    }
}
